﻿using Microsoft.EntityFrameworkCore.Migrations;
using TiaoTaoHelper.Wtm.Units.EFCore;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 移除用户管理中不需要的字段 : TransactionalMigration
    {
        /// <inheritdoc />
        protected override void UpWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Address",
                table: "FrameworkUsers");

            migrationBuilder.DropColumn(
                name: "Gender",
                table: "FrameworkUsers");

            migrationBuilder.DropColumn(
                name: "HomePhone",
                table: "FrameworkUsers");

            migrationBuilder.DropColumn(
                name: "ZipCode",
                table: "FrameworkUsers");

            migrationBuilder.AlterColumn<string>(
                name: "CellPhone",
                table: "FrameworkUsers",
                type: "nvarchar(32)",
                maxLength: 32,
                nullable: true,
                comment: "手机",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true,
                oldComment: "手机");
        }

        /// <inheritdoc />
        protected override void DownWithTransaction(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "CellPhone",
                table: "FrameworkUsers",
                type: "nvarchar(max)",
                nullable: true,
                comment: "手机",
                oldClrType: typeof(string),
                oldType: "nvarchar(32)",
                oldMaxLength: 32,
                oldNullable: true,
                oldComment: "手机");

            migrationBuilder.AddColumn<string>(
                name: "Address",
                table: "FrameworkUsers",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: true,
                comment: "地址");

            migrationBuilder.AddColumn<int>(
                name: "Gender",
                table: "FrameworkUsers",
                type: "int",
                nullable: true,
                comment: "性别");

            migrationBuilder.AddColumn<string>(
                name: "HomePhone",
                table: "FrameworkUsers",
                type: "nvarchar(30)",
                maxLength: 30,
                nullable: true,
                comment: "座机");

            migrationBuilder.AddColumn<string>(
                name: "ZipCode",
                table: "FrameworkUsers",
                type: "nvarchar(max)",
                nullable: true,
                comment: "邮编");
        }
    }
}
